<?php
class HousingController extends Zend_Controller_Action
{
    
 /**
     * @var Managers\Housing
     */
    protected $_manager;
    protected $_managerUser;
    
    public function init()
    {
       //$layout = Zend_Layout::getMvcInstance();
       //$layout->setLayout('site');
       
       //$ajaxContext = $this->_helper->getHelper('AjaxContext');

       //$ajaxContext->addActionContext('step1', 'html')
			//	->initContext();
       $this->_manager = new Managers\Housing();
       $this->view->date = new Helper_Date;
       $this->view->cutstr = new Helper_CutStr;
    }

    public function indexAction()
    {
        // action body
    }
    
     public function step1Action()
    {
       $layout = Zend_Layout::getMvcInstance();
		$layout->disableLayout();
        
    }
     public function step2Action()
    {
       $layout = Zend_Layout::getMvcInstance();
		$layout->disableLayout();
        
    }
     public function step3Action()
    {
       $layout = Zend_Layout::getMvcInstance();
		$layout->disableLayout();
        
    }
    

     public function addAction()
    {
		//$ctrl  = Zend_Controller_Front::getInstance();
		//$router = $ctrl->getRouter(); // по умолчанию возвращает rewrite router
               // $request = $this->getRequest();
               // $params = $request->getParams();
              //  if(){
               // $index = $params['controller'];
               // }
              //  echo"<pre>";
		//print_r($params);
               // echo"</pre>";
        // action body
        // создаём форму и передаём её во view
        //$form = new Application_Form_Addhousing();
        //$this->view->form = $form;

        $this->view->title = _('Додати житло');

        $this->view->items_new = $this->_manager->getNew();
    }
    public function validateformAction()
    {

        $this->_helper->viewRenderer->setNoRender();
        $this->_helper->layout->disableLayout();
        $form = new Form_ContactForm();

        $form->isValidPartial($this->_getAllParams());
        //print_r($bool);
        $json = $form->processAjax($this->getRequest ()->getPost ());
        header('Content-type: application/json');
        echo Zend_Json::encode($json);
    }


}

